<html>
  <head>
    <script src="/mqtt.js"></script>
  </head>
  <body>
    <script>
      var client = mqtt.connect();

      client.subscribe("mqtt/demo");

      client.on("message", function(topic, payload) {
        alert([topic, payload].join(": "));
      });

      client.publish("mqtt/demo", "hello world!");
    </script>
  </body>
</html>
